<?php 
	include_once('DAODiaInhabil.php');
	
	if(isset($_POST['anioInicio'])&& isset($_POST['mesInicio']) && isset($_POST['diaInicio']) && isset($_POST['anioFin'])&& isset($_POST['mesFin'])&& isset($_POST['diaFin'])){
		$sFechaInicio = $_POST['anioInicio'].'-'.$_POST['mesInicio'].'-'.$_POST['diaInicio'];
		$sFechaFin = $_POST['anioFin'].'-'.$_POST['mesFin'].'-'.$_POST['diaFin'];
		
		$oDaoDiaInhabil = new DAODiaInhabil;
		$oDiaInhabil = $oDaoDiaInhabil->guardarDiaInhabil($sFechaInicio,$sFechaFin);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dia Inhabil</title>
<script src="../script/eventos.js" type="text/javascript"></script>
</head>

<body>
	<?php
		if($oNewEvent)
			echo '<script type="text/javascript">showDiaInhabil("'.$sFechaInicio.'");</script>';
		else
			echo 'Error';
	?>

</body>
</html>
<?php 
	}else
		header('Location: addNuevoDiaInhabil.php?error=1');
?>